import request from '@/utils/request'

// 查询售后单列表
export function listRefund(query) {
    return request({
        url: '/sell/refund/mine',
        method: 'get',
        params: query
    })
}

// 查询售后单详细
export function getRefund(id) {
    return request({
        url: '/sell/refund/' + id,
        method: 'get'
    })
}

// 新增售后单
export function addRefund(data) {
    return request({
        url: '/sell/refund',
        method: 'post',
        data: data
    })
}

// 修改售后单
export function updateRefund(data) {
    return request({
        url: '/sell/refund',
        method: 'put',
        data: data
    })
}

// 删除售后单
export function delRefund(id) {
    return request({
        url: '/sell/refund/' + id,
        method: 'delete'
    })
}


export function cancelRefund(id) {
    return request({
        url: '/sell/refund/cancel',
        method: 'put',
        data: {id}
    })
}

export function handleUpdateLogistics(data) {
    return request({
        url: '/sell/refund/logistics',
        method: 'put',
        data: data
    })
}
